package com.jichangxiu.system.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jichangxiu.common.entity.po.BaseEntity;
import com.jichangxiu.system.entity.bo.SysDataBo;
import com.jichangxiu.system.entity.vo.SysDataVo;
import io.github.linpeilie.annotations.AutoMapper;
import io.github.linpeilie.annotations.AutoMappers;
import lombok.*;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.Date;

/**
 * SysData: sys_data 系统数据表
 *
 * @author JiChangXiu
 * @create 2024-06-28 13:44:19
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("sys_data")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@AutoMappers({
        @AutoMapper(target = SysDataBo.class, reverseConvertGenerate = false),
        @AutoMapper(target = SysDataVo.class, reverseConvertGenerate = false)
})
public class SysData extends BaseEntity {

    /**
     * ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    /**
     * 键名
     */
    @TableField(value = "`key`")
    private String key;

    /**
     * 键值
     */
    @TableField(value = "value")
    private String value;

    /**
     * 显示样式
     */
    @TableField(value = "display")
    private String display;

    /**
     * 是否默认
     */
    @TableField(value = "defaulted")
    private Boolean defaulted;

    /**
     * 字典ID
     */
    @TableField(value = "type_id")
    private String typeId;

    /**
     * 租户ID
     */
    @TableField(value = "tenant_id")
    private String tenantId;

    /**
     * 显示顺序
     */
    @TableField(value = "sort")
    private BigDecimal sort;

    /**
     * 备注
     */
    @TableField(value = "remark")
    private String remark;

    /**
     * 是否删除
     */
    @TableLogic
    @TableField(value = "deleted")
    private Long deleted;

    /**
     * 是否启用
     */
    @TableField(value = "enabled")
    private Boolean enabled;

    /**
     * 启用者
     */
    @TableField(value = "enabled_by")
    private String enabledBy;

    /**
     * 启用时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "enabled_time")
    private Date enabledTime;

}